#ifndef HANDLE_H
#define HANDLE_H
#pragma execution_character_set("utf-8")
#include <QObject>
#include <QDebug>
#include <local_socket.h>
#include <QTime>
#include <QCoreApplication>
#include <tcp_socket.h>
#include <QFile>
#include <QFileInfo>
#include <Windows.h>
#include <m_socket.h>
#include <common.h>
#include <QThread>
#include <QHostInfo>
#include <QDir>
#include <QCryptographicHash>
#define MB 1048576
class Handle : public QObject
{
    Q_OBJECT
public:
    int       caculate_count=1;                                                                                //计算线程数
    int       num;
    QString   id;
    Handle(int num);
private:
    QStringList  get_computerinfo();                                                                           //获取电脑信息
    void handle_localSocket(QString id, QString type, QString data,local_socket *l_socket);
    QString GetMD5(QByteArray data);
    void handle_tcpSocket(QString id, QString type, QString data, tcp_socket *t_socket);                       //处理来自tcp_socket请求
    bool isFileExist(QString fullFileName);                          //是否存在对应文件
    bool isDirExist(QString fullPath);                               //是否存在对应文件夹，不存在则创建
    void LocalSockt_unfinshsenddata(local_socket *l_socket);         //发送Localsocket未发送的任务
    void LocalSocket_SetUnfinshsenddata(QString id,QString type,QString data,emit_type emittype,QString sockettype);     //设置Localsocket未发送的任务
signals:
    void l_SocketSendData(QString id,QString type,QString data,local_socket *l_socket,emit_type te_ype,QString socketType);
    void t_SocketSendData(QString id,QString type,QString data,tcp_socket *t_socket,emit_type te_ype,QString socketType);
private slots:
    void handle_localSocket(QString id, QString type, QString data,local_socket *l_socket,Handle *handle,emit_type te_ype);
    void handle_tcpSocket(QString id, QString type, QString data, tcp_socket *t_socket,Handle *handle,emit_type te_ype);                       //处理来自tcp_socket请求
};

#endif // HANDLE_H
